package com.jeesite.modules.kj.schedule.activity;

import com.jeesite.modules.kj.entity.KjActivity;
import com.jeesite.modules.kj.entity.KjMember;
import com.jeesite.modules.kj.entity.KjProjectTeam;
import com.jeesite.modules.kj.entity.KjTeamMember;
import com.jeesite.modules.kj.exception.FreezMemberException;
import com.jeesite.modules.kj.service.KjActivityService;
import com.jeesite.modules.kj.service.KjProjectTeamService;
import com.jeesite.modules.kj.service.KjTeamMemberService;
import com.jeesite.modules.kj.utils.KjMemberUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.annotation.Schedules;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 自动更新活动状态
 */
@Component
@Configuration
@EnableScheduling
@Slf4j
public class AutoUpdateActivityStatus {
    @Autowired
    KjActivityService kjActivityService;
    @Scheduled(cron = "0 0/1 * * * ?")
    public void updateStatus(){
        log.info("正在更新活动状态");
        kjActivityService.autoSignStartActivity();
        kjActivityService.autoSignEndActivity();
        kjActivityService.autoStartActivity();
        kjActivityService.autoEndActivity();

    }


}
